from Config import db


class Note(db.Model):
    __tablename__ = 'note'
    id = db.Column(db.Integer, primary_key=True)
    title = db.Column(db.String(30), unique=False)
    body = db.Column(db.TEXT)
    user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
    user = db.relationship("User")

    def __init__(self, title, body, user_id):
        self.title = title
        self.body = body
        self.user_id = user_id


if __name__ == '__main__':
    db.create_all()
